package pack2;

public class java18 {
    public static void main(String[] arge) {
        double nums[]={5,4,11,-3,-1,256,777};
        double mean=mean(nums);
        double var=var(nums,mean);
        for (int i = 0; i < nums.length; i++) {
            nums[i]=(nums[i]-mean)/Math.sqrt(var);
            System.out.println("nums["+i+"]="+nums[i]);
        }
    }
    public static double mean(double a[]){
        int aver=0;
        for (int i = 0; i < a.length; i++) {
            aver+=a[i];
        }
        return (aver/a.length);
    }
    public static double var(double a[],double mean){
        double sum=0;
        for (int i = 0; i < a.length; i++) {
            sum+=(a[i]-mean)*(a[i]-mean);
        }
        return (sum/a.length);
    }
}